<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class SaveAddressRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id' => 'required',
            'mobile' => 'sometimes|regex:/^1[3456789]{1}\d{9}$/',
        ];
    }

    public function messages()
    {
        return [
            'mobile.required' => 'ID 不能为空',
            'mobile.regex' => '手机号 格式不正确',
        ];
    }
}
